package com.server.order;

import java.rmi.RemoteException;

import gnu.cajo.invoke.Remote;
import combat.protocol.interfaces.OnboardWeaponSystemInt;
import combat.protocol.interfaces.OrderAttackInt;
import combat.protocol.types.OrderType;

public class orderAttackImpl extends orderImpl implements OrderAttackInt {
	private static final long serialVersionUID = 1L;
	
	private OnboardWeaponSystemInt system = null;
	
	public orderAttackImpl(Object target, OnboardWeaponSystemInt weaponSystem) {
		super(target, OrderType.ATK);
		this.system = weaponSystem;
	}

	public OnboardWeaponSystemInt getSystem() {
		return system;
	}
	
	public void setSystem(OnboardWeaponSystemInt weaponSystem) {
		this.system = weaponSystem;
	}

	@Override
	public Remote getTarget_Remote() {
		try {
			return new Remote(getTarget());
		} catch (RemoteException e) {
			System.out.println("ERROR: Update getTarget function failed");
		}
		return null;
	}

	@Override
	public Remote getSystem_Remote() {
		try {
			return new Remote(getSystem());
		} catch (RemoteException e) {
			System.out.println("ERROR: Update getSystem function failed");
		}
		return null;
	}
}